package com.lxf.project;

import com.lxf.project.inteface.IOrderService;
import com.lxf.project.inteface.entity.Order;
import org.apache.dubbo.rpc.RpcContext;

public class OrderServiceImpl implements IOrderService {
    @Override
    public void save(Order parameter) {
        System.out.println(parameter);
        RpcContext rpcContext =  RpcContext.getContext();
        String serverIP =rpcContext.getRemoteHost();
        System.out.println("获取最后一次调用的api地址："+serverIP);

        String application = rpcContext.getUrl().getParameter("application");
        System.out.println("获取当前服务配置信息，所有配置信息都将转换为URL的参数："+application);
        // 注意：每发起RPC调用，上下文状态会变化



    }

    @Override
    public void update(int id) {
        System.out.println(id);
    }
}
